package com.geek.javase.ch02.test4;

/*
 *@author wangpeng
 *2025/10/10 14:00
 *@description TODO
 */
public class Director extends Employee {
    // 特有属性：交通补助
    private double transportationAllowance;

    // 无参构造方法
    public Director() {
        super(); // 调用父类无参构造方法
    }

    // 有参构造方法
    public Director(String name, String address, double baseSalary, double transportationAllowance) {
        super(name, address, baseSalary); // 调用父类有参构造方法
        this.transportationAllowance = transportationAllowance;
    }

    // getter和setter方法
    public double getTransportationAllowance() {
        return transportationAllowance;
    }

    public void setTransportationAllowance(double transportationAllowance) {
        this.transportationAllowance = transportationAllowance;
    }

    // 重写show方法
    @Override
    public void show() {
        super.show(); // 调用父类的show方法
        System.out.println("董事交通补助: " + this.transportationAllowance);
    }
}
